﻿<Window x:Class="ListViewItemFloatTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:proj="clr-namespace:ListViewItemFloatTest"
        Title="MainWindow" Height="250" Width="525" x:Name="window">
    <Window.Resources>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="proj:MouseDoubleClick.Command"  Value="{Binding ElementName=window, Path=DataContext.SelectClientCmd}"></Setter>
            <!--<Setter Property="proj:MouseDoubleClick.CommandParameter"  Value="{Binding ElementName=window, Path=DataContext.SelectedClient}"></Setter>-->
        </Style>
        <GridView x:Key="ItemsView">
            <GridViewColumn Header="Client Code" Width="85">
                <GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <TextBlock Foreground="black" Text="{Binding Path=ClientCode, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch"></TextBlock>
                    </DataTemplate>
                </GridViewColumn.CellTemplate>
            </GridViewColumn>
            <GridViewColumn Header="Client Name" Width="390">
                <GridViewColumn.CellTemplate>
                    <DataTemplate>

                        <TextBlock TextWrapping="WrapWithOverflow" Foreground="black" Text="{Binding Path=ClientName, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch">
                        </TextBlock>
                    </DataTemplate>
                </GridViewColumn.CellTemplate>
            </GridViewColumn>
        </GridView>
        

    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        
        
<ListView Grid.Row="1" View="{StaticResource ItemsView}" ItemsSource="{Binding Path=Clients, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Path=SelectedClient, Mode=OneWayToSource}" Margin="5,5,5,5" Height="150">
            
        </ListView>
        
<ListView Grid.Row="2" ItemsSource="{Binding Path=SelectedClients, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Path=SelectedClient, Mode=OneWayToSource}" Margin="5,5,5,5" Height="40">
<ListBox.ItemsPanel>
                <ItemsPanelTemplate>

                    <VirtualizingStackPanel Orientation="Horizontal" IsItemsHost="True" CanHorizontallyScroll="True" CanVerticallyScroll="False">

                    </VirtualizingStackPanel>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>

            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <Label HorizontalAlignment="Center" Content="{Binding Path=ClientCode}"></Label>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>

        
        </ListView>


    
        
    </Grid>
</Window>
